#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWebEngineView>
#include <QLineEdit>
#include <QPushButton>
#include "jscontext.h"
#include <QWebChannel>
#include <QNetworkInterface>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    /**
     * @brief 获取机器mac地址
     * @return
     */
    QStringList get_mac();
    void getcpuid(unsigned int CPUInfo[4], unsigned int InfoType);
    void getcpuidex(unsigned int CPUInfo[4], unsigned int InfoType, unsigned int ECXValue);
    /**
     * @brief 获取机器cpuId
     * @return
     */
    QString get_cpuId();
    void init();
private slots:
    void on_pbtnReflush_clicked();
    void on_pbtnSearch_clicked();

private:
    Ui::MainWindow *ui;

    QLineEdit* m_pAddressString;
    QPushButton* m_pReflush;
    QPushButton* m_pSearch;
    QWebEngineView m_view;

    JsContext* m_jsContext;
    QWebChannel* m_webChannel;
};

#endif // MAINWINDOW_H
